import torch

x = 1.0
y = 2.0

w = torch.Tensor([1.0])
b = torch.Tensor([2.0])
w.requires_grad = True
b.requires_grad = True

l = (w * x + b - y) ** 2
l.backward()
print(l)
print(w.grad)
print(b.grad)
